<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page language="java" import="java.io.*" %>
<%@ page language="java" import="java.sql.*" %>
<html>
<head>
<title>Busqueda por nombre</title>
<%
try {
	String connectionURL = "jdbc:mysql://localhost:3306/bus_bautizos";
	Connection connection = null;
	Statement statement = null;
	ResultSet rs = null;
	Class.forName("com.mysql.jdbc.Driver").newInstance();
	connection = DriverManager.getConnection(connectionURL, "root", "");
	statement = connection.createStatement();
	String QueryString = "SELECT * FROM bautizado2 WHERE nombres='"+ request.getParameter("nbs") +"' || ap_pat='"+ request.getParameter("ap") +"' || ap_mat='"+ request.getParameter("am") +"'";
	rs = statement.executeQuery(QueryString);
%>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<meta http-equiv="Content-Script-Type" content="text/javascript" /> 
	<meta http-equiv="Content-Style-Type" content="text/css" /> 
	
 	<!-- stylesheets -->
  	<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
  	<link rel="stylesheet" href="css/slide.css" type="text/css" media="screen" />
  	<link rel="stylesheet" href="css/style2.css" type="text/css" media="screen" />
    <!-- jQuery - the core -->
	<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
	<!-- Sliding effect -->
	<script src="js/slide.js" type="text/javascript"></script>
	<link rel="stylesheet" href="jqtransformplugin/jqtransform.css" type="text/css" media="all" /> 
	<link rel="stylesheet" href="css/demo.css" type="text/css" media="all" /> 
	
	<script type="text/javascript" src="requiered/jquery.js" ></script> 
	<script type="text/javascript" src="jqtransformplugin/jquery.jqtransform.js" ></script> 
	<script language="javascript"> 
		$(function(){
			$('form').jqTransform({imgPath:'jqtransformplugin/img/'});
		});
	</script>
</head>
<body>
<div id="wrapper">
        <div id="header">
			<% 

				
				//out.println(session.getAttribute("nb"));
				//out.println(session.getAttribute("pa"));
				
				if (session.getAttribute("nb")==null && session.getAttribute("")==null)
				{
					response.sendRedirect("acceso1.jsp"); 
					
				}
				else
				{
					//out.println("bien");
				}
				
				
			%>
        </div>

        <div id="menu">
                <ul>
                      <li><a href="uisistem.jsp">Registrar</a></li>
                      <li><a href="uibuscanomb.jsp">Busca Nombre</a></li>
                      <li><a href="uibuscaid.jsp">Busca ID</a></li>
                      <li><a href="uibuscafec.jsp">Busca Fecha</a></li>
                      <li><a href="imprconstancia.jsp">Constancia</a></li>
                </ul>
        </div>
        
        <div id="menu">
                <ul>
                      <li><a href="confirmacion.jsp">Confirmaci&oacute;n</a></li>
                      <li><a href="boletaconf.jsp">Boleta Confirmaci&oacute;n</a></li>
                </ul>
        </div>

  <div id="sidebar"> 
    <ul>
      <li>&nbsp;<font color="#999999" size="4" face="Geneva, Arial, Helvetica, sans-serif">
      <strong>Menu Principal</strong></font></li> 
      <li><a href="#">Galeria*</a></li>
      <li><a href="#">Frailes*</a></li>
      <li>
      	<form method="post" action="blcierra.jsp"><br/>
  		<div class="rowElem"><input type="hidden" name="op" value="cerrado"/></div>
  		<input type="submit" value="Cerrar Sesi&oacute;n"/>
		</form>
	  </li>      
    </ul>
  </div>

      <div id="content">
      <div class="entry">
                <br/><br/>
      <div class="entry-title">
        <p><font color="#000000" size="4" face="times roman numeral">Coincidencias encontradas</font></p>
      </div>

      <div class="entry">
		<TABLE cellspacing=10>
			<tr>
			<td align="center">Id</td>
			<td align="center">Nombre</td>
			<td align="center">Ap_pat</td>
			<td align="center">Ap_mat</td>
			<td align="center">Fec_Nac</td>
			<td align="center">Fec_Bau</td>
			<td align="center">Libro</td>
			<td align="center">Foja</td>
			<td align="center">Acta</td>			
			</tr>
		<%
			while (rs.next()) {
		%>
			<TR>
			<TD aling="center"><%=rs.getInt("id_b")%></TD>
			<TD align="center"><%=rs.getString("nombres")%></TD>
			<TD align="center"><%=rs.getString("ap_pat")%></TD>
			<TD align="center"><%=rs.getString("ap_mat")%></TD>
			<!-- <TD align="center"><%=rs.getInt("ano")%></TD> -->
			<TD align="center" style="font-size:small;"><%=rs.getDate("fec_nac").toString()%></TD>
			<TD align="center" style="font-size:small;"><%=rs.getDate("fec_bau").toString()%></TD>
			<TD align="center"><%=rs.getString("libro")%></TD>
			<TD align="center"><%=rs.getInt("foja")%></TD>
			<TD align="center"><%=rs.getInt("acta")%></TD>
			</TR>
		<% }
			%>
	<%
		rs.close();
		statement.close();
		connection.close();
		} catch (Exception ex) {
	%>
	<font size="1" color="red"></b>
	<%
		out.println("No se pudo conectar con la BD.");
		}
	%>
	</font>
	</TABLE>
		<p><font color="#000000" face="Arial" size="2"><br/>
          <br/>
          <br/>
          </font></p>
      </div>
   </div>
  </div>

  <div id="footer">
    <div align="center"> 
      <p><font color="#FFFFFF">Copyright &copy; 2011 Derechos Reservados - </font><a href="#"><font color="#FFFFFF">SIA Soft</font></a><br />
      </p>
    </div>
  </div>
</div>
</body>
</html>